package com.myidis.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.myidis.entity.RightUserGroupRole;

public interface RightUserGroupRoleMapper {
	@Select("SELECT * FROM right_group_role")
    @Results({
    	@Result(property = "gid",  column = "gid"),
    	@Result(property = "rid",  column = "rid")
    })
    List<RightUserGroupRole> all();

    @Select("SELECT * FROM right_group_role WHERE id = #{id}")
    @Results({
    	@Result(property = "gid",  column = "gid"),
    	@Result(property = "rid",  column = "rid")
    })
    RightUserGroupRole getOne(int id);

    @Insert("INSERT INTO right_group_role(gid, rid) VALUES(#{gid}, #{rid})")
    int insert(RightUserGroupRole dept);

    @Update("UPDATE right_group_role SET gid = #{gid}, rid = #{rid} WHERE id = #{id}")
    int update(RightUserGroupRole dept);

    @Delete("DELETE FROM right_group_role WHERE id = #{id}")
    int delete(int id);
}
